<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue3 - class-01</title>
  <link href="favicon.ico" rel="shortcut icon">
  <script src="../../js/vue.js"></script>
  <style>
    button {
      width: 100px;
      height: 30px;
    }
  </style>
</head>

<body>

  <!-- <div id="event-handling">
    <p>{{ message }}</p>
    <button v-on:click="reverseMessage">反转 Message</button>
  </div>

  <script>
    const EventHandling = {
      data() {
        return {
          message: 'Hello Vue.js!'
        }
      },
      methods: {
        reverseMessage() {
          this.message = this.message
            .split('')
            .reverse()
            .join('')
        }
      }
    }

    Vue.createApp(EventHandling).mount('#event-handling')
  </script> -->

  <div id="counter">
    Counter: {{ counter }}
    <button @click="onCounter"> + </button>
  </div>
  <script>
    const Counter = {
      data() {
        return {
          counter: 0
        }
      },
      methods: {
        onCounter() {
          this.counter ++
        }
      }
    }

    Vue.createApp(Counter).mount('#counter')
  </script>
</body>

</html>